package com.tencent.examples.blueking.mongo.repository;

import com.tencent.examples.blueking.mongo.model.InstAsst;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;
import org.springframework.data.repository.query.QueryByExampleExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface InstAsstRepository extends MongoRepository<InstAsst, String>, QueryByExampleExecutor<InstAsst> {

    //根据模块id和实例id确定实例数据及其关联的实例信息
    @Query(value = "{" +
            "    bk_obj_id:?0,\n" +
            "    bk_inst_id:?1\n" +
            "}")
    List<InstAsst> findInstAsstBy(String bk_obj_id, int bk_inst_id);

}
